package com.uzai.console.web.sop;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.sop.sopriskalarm.SopRiskAlarmDto;
import com.uzai.console.dto.sop.sopriskalarm.SopRiskAlarmOrderDto;
import com.uzai.console.service.sop.SopRiskAlarmService;
import com.uzai.console.vo.sop.sopriskalarm.SopRiskAlarmOrderVo;
import com.uzai.console.vo.sop.sopriskalarm.SopRiskAlarmVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 客户维护|提现风控
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "提现风控",tags = "客户维护|提现风控")
@ApiSort(7)
@RestController
public class SopRiskAlarmController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(SopRiskAlarmController.class);

    @Autowired
    private SopRiskAlarmService sopRiskAlarmService;

    @ApiOperation(value = "查询提现风控报警详情", notes = "查询提现风控报警详情", response = SopRiskAlarmVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/sopRiskAlarm/findSopRiskAlarm")
    public Object findSopRiskAlarm(){
        return sopRiskAlarmService.findSopRiskAlarm(getLoginInfo().getMerId());
    }

    @ApiOperation(value = "保存提现风控报警信息", notes = "保存提现风控报警信息")
    @ApiOperationSupport(order = 2)
    @PostMapping("/sopRiskAlarm/updateSopRiskAlarm")
    public Object updateSopRiskAlarm(@RequestBody SopRiskAlarmDto sopRiskDto){
        sopRiskAlarmService.updateSopRiskAlarm(sopRiskDto);
        return true;
    }

    @ApiOperation(value = "查询订单风控报警详情", notes = "查询订单风控报警详情", response = SopRiskAlarmOrderVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/sopRiskAlarm/findSopRiskAlarm/order")
    public Object findSopRiskAlarmOrder(){
        return sopRiskAlarmService.findSopRiskAlarmOrder(getLoginInfo().getMerId());
    }

    @ApiOperation(value = "保存订单风控报警信息", notes = "保存提现风控报警信息")
    @ApiOperationSupport(order = 2)
    @PostMapping("/sopRiskAlarm/updateSopRiskAlarm/order")
    public Object updateSopRiskAlarmOrder(@RequestBody SopRiskAlarmOrderDto sopRiskAlarmOrderDto){
        sopRiskAlarmService.updateSopRiskAlarmOrder(sopRiskAlarmOrderDto);
        return true;
    }

}
